<template>
    <van-popup v-model="visible" round closeable :close-on-click-overlay="false" close-icon="close" style="width: 90%;">
      <h3 class="align-center p-y-15 font-18">{{ title }}</h3>
      <div class="p-a-15" style="line-height: 28px;max-height: 500px;overflow-y:auto;overflow-x:hidden;" v-html="content"></div>
      <div class="align-center p-y-15">
        <van-button type="info" @click="handleClick('confirm')">同意</van-button>
      </div>
    </van-popup>
  </template>
  
  <script>
  import agreement from './content';
  export default {
      data(){
          return{
              visible: false,
              title: '',
              content: '',
          }
      },
      methods:{
          init(type){
              this.visible = true;
              this.title = agreement[type].title;
              this.content = agreement[type].content;
          },
          handleClick(type){
            if(type == 'confirm'){
                this.$emit('confirm');
            }
            this.visible = false;
          }
      }
  }
  </script>
  
  <style>
  
  </style>